const TokenKey = 'Admin-Token'

export function getToken() {
	let value=""
	try {
		value = uni.getStorageSync(TokenKey);
	} catch (e) {
		// error
		try{
			
		}catch(e){
			console.log(e);
		}
	}
  return value
}

export function setToken(token) {
	try {
		uni.setStorageSync(TokenKey, token);
	} catch (e) {
		console.log("设置Token异常")
		// error
		uni.setStorage({
			key: TokenKey,
			data: token,
			success: () => {
				console.log('缓存:', key, '设置成功');
			},
			fail: () => {
				console.log('缓存:', key, '设置失败');
			}
		});
	}
}

export function removeToken() {
	uni.removeStorage({
		key: TokenKey,
		success: function (res) {
			console.log('删除:',TokenKey,'success');
		}
	});
}



